package com.cn.jx.manager.po;

import static com.jx.util.CodeUtil.getRandomId;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import com.jx.enumType.YesNoEnum;

/**
 * <p>Role 角色POJO类 对应数据库表名 SYS_ROLE
 * <p>实现<{@link Serializable <tt>序列化接口</tt>}
 * <p>实现<{@link BaseEntity <tt>BaseEntity</tt>}
 *  
 * @author <h1>jiangxu2  2019年11月21日</h1>
 * @version v1.11.20.2019
 * @since 1.0
 * 
 */
@Entity
@Table(name="SYS_ROLE")
public class Role extends BaseEntity{

	private static final long serialVersionUID = 1061761175967355049L;
	
	/** <p>角色名称<p>设置为{@link String String}类型*/
	@Column(name="role_name",length=64)
	private String roleName;
	
	/** <p>角色编码<p>设置为{@link String String}类型*/
	@Column(name="role_code",length=64,unique=true,nullable=false)
	private String roleCode;
	
	/** <p>描述<p>设置为{@link String String}类型*/
	@Column(name="descrb",length=255)
	private String descrb;
	
	/** <p>所属应用<p>设置为{@link String String}类型*/
	@Column(name="r_apply",length=10)
	private String apply;

	/** <p>初始化创建类 @return */
	public static Role getInstance(String operUser){
		Date day=new Date();
		Role m=new Role();
		m.setId(getRandomId());
		m.setDelFlg(YesNoEnum.NO.getCode());
		m.setValidFlg(YesNoEnum.YES.getCode());
		m.setCreateTime(day);
		m.setOperatTime(day);
		m.setOperatUser(operUser);
		m.setCreateUser(operUser);
		return m;
	}
	
	/** <p>{@link String String getApply()*/
	public String getApply() {
		return apply;
	}
	/** <p>setApply({@link String String apply})*/
	public void setApply(String apply) {
		this.apply = apply;
	}
	/** <p>{@link String String}<p>getDescrb()*/
	public String getDescrb() {
		return descrb;
	}
	/** <p>{@link String String}<p>getRoleName()*/
	public String getRoleName() {
		return roleName;
	}
	/** <p>{@link String String}<p>getRoleCode()*/
	public String getRoleCode() {
		return roleCode;
	}

	/** <p>setDescrb({@link String descrb})*/
	public void setDescrb(String descrb) {
		this.descrb = descrb;
	}
	/** <p>setRoleName({@link String roleName})*/
	public void setRoleName(String roleName) {
		this.roleName = roleName;
	}
	/** <p>setRoleCode({@link String roleCode})*/
	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}
}
